# encoding: utf-8

from zheezes.util.ip2addr import qq_ip_to_addr

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

class MainPage(webapp.RequestHandler):
    def get(self):
        ip = self.request.get("ip")
        addr = qq_ip_to_addr(ip)
        #print username
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.out.write('%s - %s' % (ip, addr))
        #self.response.out.write(username)
        
application = webapp.WSGIApplication([('/.*', MainPage)], debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
